package org.tc.product.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.tc.product.entity.Commoditydetails;
import org.tc.product.mapper.CommoditydetailsMapper;
import org.tc.product.service.CommoditydetailsService;

import java.util.List;

@Service
@RestController
public class CommoditydetailsServiceImpl implements CommoditydetailsService {

    @Autowired
    private CommoditydetailsMapper commoditydetailsMapper;

    @Override
    public List<Commoditydetails> selectAll() {
        return commoditydetailsMapper.selectAll();
    }

    @Override
    public List<Commoditydetails> selectComDeByid(@RequestParam("commodityid") Integer commodityid) {
        List<Commoditydetails> list = commoditydetailsMapper.selectComDeByid(commodityid);
        return list;
    }

    @Override
    public int insertComDe(@RequestBody Commoditydetails record) {
        int count = commoditydetailsMapper.insert(record);
        return count;
    }
}
